﻿using ShevaEngine.Core.Interfaces;
using ShevaEngine.Core.Modules.Graphics;

namespace ShevaEngine.Core.Modules.Scenes
{
    /// <summary>
    /// Draw call node.
    /// </summary>
    public class GraphicsSceneObjectDrawCallNode : GraphicsSceneObjectNode
    {
        /// <summary>Draw call key.</summary>
        public DrawCallKey DrawCallKey;
        /// <summary>Draw call.</summary>
        public IDrawCall DrawCall;

        /// <summary>
        /// Constructor.
        /// </summary>
        public GraphicsSceneObjectDrawCallNode()
            : base()
        {

        }

        /// <summary>
        /// Override Add in rendering pipeline method.
        /// </summary>
        /// <param name="renderingPipeline"></param>
        /// <param name="worldMatrix"></param>
        public override void AddInRenderingPipeline(RenderingPipeline renderingPipeline, Microsoft.Xna.Framework.Matrix worldMatrix)
        {
            renderingPipeline.AddOpaqueGraphicsObject(this.DrawCallKey, this.DrawCall, worldMatrix);

            base.AddInRenderingPipeline(renderingPipeline, worldMatrix);
        }
    }
}
